@import './abstracts/variable';
@import './abstracts/mixin';
@import './icon.scss';

@include b(tabs) {
  position: relative;
  background: #fff;

  @include e(nav) {
    position: relative;
    height: $-tabs-nav-height;
    overflow: hidden;
    background: #fff;

    @include halfPixelBorder;
  }
  @include e(nav-container) {
    position: relative;
    display: flex;
    box-sizing: content-box;
    padding-bottom: 15px;
    overflow: hidden;
    user-select: none;
  }
  @include e(nav-item) {
    flex: 1;
    min-width: 0;
    text-align: center;
    height: $-tabs-nav-height;
    line-height: $-tabs-nav-height;
    font-size: $-tabs-nav-fs;
    color: $-tabs-nav-color;
    transition: color .3s;
    -webkit-tap-highlight-color: transparent;

    @include when(active) {
      color: $-tabs-nav-active-color;
    }
    @include when(disabled) {
      color: $-tabs-nav-disabled-color;
    }
  }
  @include e(line) {
    position: absolute;
    bottom: 16px;
    left: 0;
    height: $-tabs-nav-line-height;
    background: $-tabs-nav-active-color;
    z-index: 1;
  }
  @include e(container) {
    position: relative;
    overflow: hidden;
  }
  @include e(body) {
    display: flex;
    width: 100%;
    height: 100%;
  }
  @include e(map) {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
  }
  @include e(map-btn) {
    position: absolute;
    right: 0;
    top: 0;
    width: $-tabs-nav-height;
    height: $-tabs-nav-height;
    line-height: $-tabs-nav-height;
    text-align: center;
    color: $-tabs-nav-map-arrow-color;
    z-index: 3;
    background: #fff;
    -webkit-tap-highlight-color: transparent;
    @include halfPixelBorder;

    &::before {
      position: absolute;
      content: '';
      top: 0;
      bottom: 0;
      left: 0;
      width: 1px;
      transform: scaleX(0.5);
      background: $-color-border-light;
    }
  }
  @include e(map-arrow) {
    display: block;
    transition: transform .3s;

    @include when(open) {
      transform: rotate(180deg);
    }
  }
  @include e(map-header) {
    position: relative;
    padding-left: 17px;
    height: $-tabs-nav-height;
    line-height: $-tabs-nav-height;
    font-size: $-tabs-nav-map-fs;
    color: $-tabs-nav-map-color;
    transition: opacity .3s;
    background: #fff;
    opacity: 0;

    @include halfPixelBorder;
  }
  @include e(map-body) {
    display: flex;
    flex-wrap: wrap;
    padding: 20px 15px 10px;
    background: #fff;
    transition: transform .3s;
    transform: scaleY(0);
    transform-origin: center top;

    @include when(open) {
      transform: scaleY(1);
    }
  }
  @include e(map-nav-item) {
    flex-basis: 33%;

    &:nth-child(3n + 2) {
      text-align: center;
    }
    &:nth-child(3n + 3) {
      text-align: right;
    }
  }

  @include e(map-nav-btn) {
    display: inline-block;
    width: 98px;
    height: 26px;
    border: 1px solid $-tabs-nav-map-button-border-color;
    margin-bottom: 10px;
    border-radius: $-tabs-nav-map-button-radius;
    color: $-tabs-nav-map-color;
    font-size: $-tabs-nav-map-fs;
    text-align: center;
    transition: color .3s, border-color .3s;
    @include buttonClear;
    @include lineEllipsis;

    @include when(active) {
      color: $-tabs-nav-active-color;
      border-color: $-tabs-nav-active-color;
    }
    @include when(disabled) {
      color: $-tabs-nav-disabled-color;
      border-color: #f4f4f4;
    }
  }
  @include e(mask) {
    position: absolute;
    top: $-tabs-nav-height;
    left: 0;
    right: 0;
    bottom: 0;
    background: $-tabs-nav-map-modal-bg;
    opacity: 0;
    transition: opacity .3s;
  }

  @include when(slide) {
    .wd-tabs__nav-container {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }
    .wd-tabs__nav-item {
      flex: 0 0 auto;
      padding: 0 17px;
    }
  }
  @include when(map) {
    .wd-tabs__nav {
      padding-right: 40px;
    }
  }
}
@media (max-width: 330px) {
  .wd-tabs__map-nav-btn {
    width: 90px;
  }
}